package cn.hma.jftpl.controller;

import java.util.List;

import com.jfinal.core.Controller;

import cn.hma.jftpl.model.Film;

public class FilmController extends Controller {
	public void index() {
		redirect("/film/list");
	}

	public void list() {

	}

	public void add() {
		setAttr("name", "马雄杰");

	}

	public void delete() {
		int id= getParaToInt();
		boolean flag = Film.dao.deleteById(id);
		renderJson(flag);

	}
	
	public void getList() {
		List<Film> films = Film.dao.find("select * from films");
		renderJson(films);
	}
}
